import java.io.IOException;
import java.util.StringTokenizer;

public class Main{
	public static void main(String[] args) throws IOException {

		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));

		int number = Integer.parseInt(r.readLine());
		for (int i = 0; i < number; i++) {
			String s = r.readLine();
			StringTokenizer tokenizer = new StringTokenizer(s);

			int n = Integer.parseInt(tokenizer.nextToken());
			int a = Integer.parseInt(tokenizer.nextToken());
			int d = Integer.parseInt(tokenizer.nextToken());
			int result = n * (2 * a + (n - 1) * d);
			System.out.println(result / 2);
		}

	}
}